﻿using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace LitTools
{
    [CreateAssetMenu(menuName = "LitTools/LitLocalization/TextConfig")]
    public class LocalizationTextConfig : ScriptableObject
    {
        public StringItem[] textArray;


        public string GetLanguageString(int id, string language, string defaultText)
        {
            //TODO:判断并加载对应语言表
            if (textArray.Length < id)
            {
                Debug.LogError($"不存在id:{id}");
                return defaultText;
            }
            return textArray[id].value;
        }
    }

    [Serializable]
    public class StringItem
    {
        public string key;
        public string value;
    }
}
